package com.usian.controller;

import com.usian.feign.TopicOrPaperFeign;
import com.usian.pojo.B.day10.TopicTest;
import com.usian.r.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author BYBL
 * @date 2023/8/30
 */
@RestController
public class TopicOrPaperController {

    @Autowired
    TopicOrPaperFeign topicOrPaperFeign;

    @RequestMapping("/topicTest/findTopicOrPaper")
    public R findTopicOrPaper(TopicTest topicTest,Integer id){
        try {
            R topicOrPaper = topicOrPaperFeign.findTopicOrPaper(topicTest,id);
            return R.success(topicOrPaper.getData());
        } catch (Exception e) {
            e.printStackTrace();
            return R.error();
        }
    }
}
